{% extends "online/layout.html" %}

{% block content %}

<a href="/online/create">leave message</a>
<table border="1" style="width:100%;">
    <thead>
        <tr>
            <th>Date</th>
            <th>username</th>
            <th>title</th>
            <th>content</th>
        </tr>
    </thead>
    <tbody>
        {% if messages %}
        {% for message in messages %}
        <tr>
            <td>{{message.publish_date|date:'Y-m-d H:i:s'}}</td>
            <td>{{message.username}}</td>
            <td>{{message.title}}</td>
            <td>{{message.contents}}</td>
        </tr>
        {% endfor %}
        {%else%}
        <tr><td colspan="4">no data</td></tr>
        {%endif%}
    </tbody>
</table>

{% endblock %}
